package oj;

//检查两个字符串数组是否相等：给你两个字符串数组 word1 和 word2 。如果两个数组表示的字符串相同，返回 true ；否则，返回 false 。
public class Solution_1662 {
    public static boolean arrayStringsAreEqual(String[] word1, String[] word2) {
        StringBuffer sb = new StringBuffer();
        StringBuffer sb2 = new StringBuffer();
        for(int i = 0 ; i < word1.length; i++){
            sb.append(word1[i]);
        }
        for(int j = 0 ;j < word2.length ;j++){
            sb2.append(word2[j]);
        }
        String s1 = sb.toString();
        String s2 = sb2.toString();

        return s1.equals(s2);
    }

    public static void main(String[] args) {
        String[] w1 = {"a","cb"};
        String[] w2 = {"a","bc"};
        System.out.println(arrayStringsAreEqual(w1,w2));
    }
}
